package org.xb.Demo;

/**
 * @Author
 * @Description
 * @Date created in 17:07 2023/12/11
 */
public class Client {
    public static void main(String[] args) {
        //这里出现了双重耦合会有问题的 耦合是在Secretary和StockObserver进行耦合了
        //违反了开闭合的原则
        Secretary secretary = new Secretary();

        StockObserver zhangSan = new StockObserver("zhangSan", secretary);
        StockObserver wangWu = new StockObserver("wangWu", secretary);

        secretary.setAction("老板来了");

        secretary.addNotify(zhangSan);
        secretary.addNotify(wangWu);

        secretary.Notify();
    }
}
